package com.xiashitech.agent.instrumentation.base.context;

import lombok.Getter;
import lombok.Setter;

import java.util.Objects;

/**
 * trace传递变量内容，包含value和metadata
 * @author zhaoyk
 */
@Getter
@Setter
public class ContextVarEntry {

    private String value;

    private String metadata;

    public ContextVarEntry(String value) {
        this.value = value;
    }

    public ContextVarEntry(String value, String metadata) {
        this.value = value;
        this.metadata = metadata;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ContextVarEntry that = (ContextVarEntry) o;
        return Objects.equals(value, that.value) && Objects.equals(metadata, that.metadata);
    }

}
